extends InputControl

@onready var textureRect = $TextureRect
@onready var bg = $ColorRect

var data


func init(_entityData):
	data = _entityData
	
	var headIconResource = data.uiHeadIcon
	var _texture = Global.createIconAtlasTexture(headIconResource)
	textureRect.texture = _texture
	

func onMouseLeftButtonPressed():
	get_parent().onSelectEntity(self, data)


func setSelected(b):
	bg.visible = b
	
